package com.kuzan.autocloud.common.model.workflow.runtime;

import com.kuzan.autocloud.common.model.Base;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

/**
 * <p>Description: 轨迹</p>
 *
 * @author kuzank
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "sys_workflow_run_track")
public class WorkFlowRunTrack extends Base {

    @Column(length = 32)
    private String workflow;
    @Column(length = 32)
    private String runid;
    @Column(length = 32)
    private String curnode;
    @Column(length = 32)
    private String targetnode;
    @Lob
    @Column(columnDefinition = "TEXT")
    private String operators;
    @Column(length = 32)
    private String processed;
    @Column(length = 32)
    private String pretrack;


    public static WorkFlowRunTrack of(String workflow, String runid, String curnode, String targetnode) {
        WorkFlowRunTrack workFlowRunTrack = new WorkFlowRunTrack();
        workFlowRunTrack.setWorkflow(workflow);
        workFlowRunTrack.setRunid(runid);
        workFlowRunTrack.setCurnode(curnode);
        workFlowRunTrack.setTargetnode(targetnode);
        return workFlowRunTrack;
    }
}
